package com.hsgene.order.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.order.service.api.impl.ConsignAddressServiceImpl;
import com.hsgene.user.domain.GeneticTestingUserAddress;
import com.hsgene.user.dto.address.ConsignAddressDto;
import com.hsgene.user.dto.address.GeneticTestingUserAddressDetails;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 收货地址Controller
 *
 * @author wangbing
 * @version 1.0, 2018/8/6
 */
@FeignClient(name = "ms-mod-user", path = "/v1.0/genetic/testing", fallback = ConsignAddressServiceImpl.class)
public interface ConsignAddressService {

    /**
     * 获取用户默认收货地址
     *
     * @param userId 用户id
     * @return 收货地址信息
     */
    @Deprecated
    @GetMapping("{userId}/default")
    ApiResult<ConsignAddressDto> getDefaultConsignAddress(@PathVariable("userId") String userId);

    /**
     * 查询指定地址id的地址信息
     *
     * @param addressId 地址id
     * @return 地址信息
     */
    @GetMapping("ground/servant/addresses/{address_id}")
    ApiResult<GeneticTestingUserAddress> findAddressInfo(@PathVariable("address_id") String addressId);

    /**
     * 根据用户id获取地服收货地址详细信息
     *
     * @param userId 用户id
     * @return GeneticTestingUserAddressDetails
     * @description 根据用户id获取地服收货地址详细信息
     * @author maodi
     * @createDate 2018/11/9 13:40
     */
    @GetMapping("ground/servant/addresses/details/{user_id}")
    ApiResult<GeneticTestingUserAddressDetails> queryAddressDetails(@PathVariable("user_id") String userId);
}
